// hash - 时间戳
function pz(val, len = 2) {
  val = val + ''
  if (!val) {
    return val
  }
  if (String(val).length >= len) {
    return val
  }
  return `${new Array(len - 1).fill('0').join('')}${val}`
}
const _t = new Date()
const _hashstamp =
  '' +
  _t.getFullYear() +
  pz(_t.getMonth() + 1) +
  pz(_t.getDate()) +
  pz(_t.getHours()) +
  pz(_t.getMinutes()) +
  pz(_t.getSeconds()) +
  pz(_t.getMilliseconds(), 3)

module.exports = {
  _hashstamp
}
